import unittest
# from htmltestreport import HTMLTestReport
import unittestreport
from config import app_path
from log.logging_use import init_log_config
from scripts.Ihrm_add_case import TestAdd
from scripts.Ihrm_login_case import TestIhrmLogin

init_log_config(app_path + "/log/ihrm_log.log")
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestIhrmLogin))
suite.addTest(unittest.makeSuite(TestAdd))
# runner = HTMLTestReport(app_path + "/report/html_report.html", "登录和添加员工信息的一个测试报告",
#                         "简单的多功能测试报告")
# unittestreport.TestRunner(suite,filename=文件存放路径,title=测试报告标题,desc='测试生成的报告描述,templates=样式,tester=测试人员)
runner = unittestreport.TestRunner(suite, filename=app_path + "/report/html_report.html",
                                   title="登录和添加员工信息的一个测试报告",
                                   desc="简单的多功能测试报告", templates=2, tester="白白")
runner.run()
# runner.run(suite)
runner.send_email(host="smtp.qq.com",
                  port=465,
                  user="2574634669@qq.com",
                  password="bbfdvwpjqqoceaje",
                  to_addrs="2574634669@qq.com")
